//请求拦截器
$.ajaxPrefilter(function (options) {
  options.url = "http://www.liulongbin.top:3007" + options.url;
  // console.log(options);
  if (options.url.indexOf("/my/") > -1) {
    options.headers = {
      Authorization: localStorage.getItem("token") || "",
    };
    options.complete = function (res) {
      // console.log(res, "接口调用完成");
      // 判断接口是否失效
      if (
        res.responseJSON.status === 1 &&
        res.responseJSON.message === "身份认证失败！"
      ) {
        localStorage.clear();
        location.href = "/login.html";
      }
    };
  }
});
